//
//  NProblemCollectionViewImageCell.m
//  nncloud
//
//  Created by gdy on 2018/9/27.
//  Copyright © 2018年 youedata. All rights reserved.
//

#import "NProblemCollectionViewImageCell.h"
#import "ImageZoom.h"
@implementation NProblemCollectionViewImageCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageV = [UIImageView new];
        [self.contentView addSubview:self.imageV];
        self.imageV.userInteractionEnabled = YES;
        [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(self.width, 60));
            make.center.equalTo(self.contentView);
        }];
        
        //添加点击事件
        UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scanBigImageClick:)];
        [self.imageV addGestureRecognizer:tapGestureRecognizer];
        
    }
    return self;
}

#pragma mark - 浏览大图点击事件
-(void)scanBigImageClick:(UITapGestureRecognizer *)tap{
//    NSLog(@"点击图片");
    UIImageView *clickedImageView = (UIImageView *)tap.view;
    [ImageZoom imageZoomWithImageView:clickedImageView];
}



@end
